Skip to content

fix(cli): add implicit limit to sandbox list#1164

Merged
jakubno merged 3 commits into
mainfrom
chore/add-default-limit-to-cli-list
Mar 9, 2026
Merged

fix(cli): add implicit limit to sandbox list#1164
jakubno merged 3 commits into
mainfrom
chore/add-default-limit-to-cli-list

Conversation

@jakubno
Copy link
Copy Markdown
Member

@jakubno jakubno commented Feb 25, 2026

Note

Low Risk
Low risk: CLI-only behavior change that adds a default cap and minor output messaging; main risk is surprising users who previously relied on unlimited listing unless they pass --limit 0.

Overview
Adds an implicit default limit to sandbox list (now defaults to 1000, with --limit 0 meaning no limit) to avoid unbounded sandbox listing.

Updates listSandboxes to return { sandboxes, hasMore } and prints a note in pretty output when results are truncated, while keeping API pagination capped at 100 per page.

Written by Cursor Bugbot for commit 3a29103. This will update automatically on new commits. Configure here.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 25, 2026

🦋 Changeset detected

Latest commit: 3a29103

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@e2b/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 25, 2026

Package Artifacts

Built from fbd1a1a. Download artifacts from this workflow run.

JS SDK (e2b@2.13.1-chore-add-default-limit-to-cli-list.0):

npm install ./e2b-2.13.1-chore-add-default-limit-to-cli-list.0.tgz

CLI (@e2b/cli@2.7.3-chore-add-default-limit-to-cli-list.0):

npm install ./e2b-cli-2.7.3-chore-add-default-limit-to-cli-list.0.tgz

Python SDK (e2b==2.14.0+chore-add-default-limit-to-cli-list):

pip install ./e2b-2.14.0+chore.add.default.limit.to.cli.list-py3-none-any.whl

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment thread packages/cli/src/commands/sandbox/list.ts
Comment thread packages/cli/src/commands/sandbox/list.ts
@jakubno jakubno marked this pull request as ready for review March 9, 2026 20:12
@jakubno jakubno merged commit b0ab7f7 into main Mar 9, 2026
34 of 35 checks passed
@jakubno jakubno deleted the chore/add-default-limit-to-cli-list branch March 9, 2026 20:16
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a291032c3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const sandboxes = await listSandboxes({
limit: options.limit,
const limit =
options.limit === 0 ? undefined : (options.limit ?? DEFAULT_LIMIT)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Guard against NaN limit bypassing implicit cap

When --limit is passed a non-numeric value (for example --limit foo), parseInt yields NaN, and this expression keeps that NaN instead of falling back to DEFAULT_LIMIT. In listSandboxes, NaN is then treated as falsy by !limit, which makes the loop behave like “no limit” and can fetch the full sandbox list, defeating the new implicit cap and potentially causing unexpectedly large/unbounded queries from a simple typo.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants